home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmMap
- Caption = "The Map Program"
- ClientHeight = 3225
- ClientLeft = 1665
- ClientTop = 2055
- ClientWidth = 4425
- Height = 3915
- Icon = "MAP.frx":0000
- Left = 1605
- LinkTopic = "Form1"
- ScaleHeight = 3225
- ScaleWidth = 4425
- Top = 1425
- Width = 4545
- Begin TegomapLibCtl.TegoMap TegoMap1
- Height = 3210
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 4440
- _version = 65536
- _extentx = 7832
- _extenty = 5662
- _stockprops = 64
- mappicture = "MAP.frx":030A
- maskpicture = "MAP.frx":7F54
- autosize = -1 'True
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuSize
- Caption = "&Size"
- Begin VB.Menu mnuNormal
- Caption = "&Normal"
- End
- Begin VB.Menu mnuSmall
- Caption = "&Small"
- End
- Begin VB.Menu mnuLarge
- Caption = "&Large"
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "&Help"
- Begin VB.Menu mnuAbout
- Caption = "About..."
- End
- End
- Attribute VB_Name = "frmMap"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- ' All variables must be declared.
- Option Explicit
- ' Declare variables to hold the default
- ' width and height of the form.
- Dim gDefaultWidth
- Dim gDefaultHeight
- Private Sub Form_Load()
- ' Store the default height and width of the form.
- gDefaultHeight = Me.Height
- gDefaultWidth = Me.Width
- ' Specify the total number of regions.
- TegoMap1.NumberOfRegions = 8
- ' Define region #1 (the man's right ear).
- TegoMap1.RegionName(1) = "right ear"
- TegoMap1.RegionColor(1) = QBColor(12) 'Light Red.
- TegoMap1.RegionX1(1) = 0
- TegoMap1.RegionY1(1) = 92
- TegoMap1.RegionX2(1) = 43
- TegoMap1.RegionY2(1) = 136
- ' Define region #2 (the man's left ear).
- TegoMap1.RegionName(2) = "left ear"
- TegoMap1.RegionColor(2) = QBColor(12) 'Light Red.
- TegoMap1.RegionX1(2) = 252
- TegoMap1.RegionY1(2) = 92
- TegoMap1.RegionX2(2) = 295
- TegoMap1.RegionY2(2) = 136
- ' Define region #3 (the man's right eye).
- TegoMap1.RegionName(3) = "right eye"
- TegoMap1.RegionColor(3) = QBColor(12) 'Light Red.
- TegoMap1.RegionX1(3) = 82
- TegoMap1.RegionY1(3) = 90
- TegoMap1.RegionX2(3) = 129
- TegoMap1.RegionY2(3) = 118
- ' Define region #4 (the man's left eye).
- TegoMap1.RegionName(4) = "left eye"
- TegoMap1.RegionColor(4) = QBColor(12) 'Light Red.
- TegoMap1.RegionX1(4) = 166
- TegoMap1.RegionY1(4) = 90
- TegoMap1.RegionX2(4) = 213
- TegoMap1.RegionY2(4) = 118
- ' Define region #5 (the man's nose).
- TegoMap1.RegionName(5) = "nose"
- TegoMap1.RegionColor(5) = QBColor(12) 'Light Red.
- TegoMap1.RegionX1(5) = 140
- TegoMap1.RegionY1(5) = 92
- TegoMap1.RegionX2(5) = 151
- TegoMap1.RegionY2(5) = 148
- ' Define region #6 (the man's mouth).
- TegoMap1.RegionName(6) = "mouth"
- TegoMap1.RegionColor(6) = QBColor(10) 'Light Green.
- TegoMap1.RegionX1(6) = 79
- TegoMap1.RegionY1(6) = 132
- TegoMap1.RegionX2(6) = 220
- TegoMap1.RegionY2(6) = 189
- ' Define region #7 (the man's hair).
- TegoMap1.RegionName(7) = "hair"
- TegoMap1.RegionColor(7) = QBColor(12) 'Light Red.
- TegoMap1.RegionX1(7) = 56
- TegoMap1.RegionY1(7) = 0
- TegoMap1.RegionX2(7) = 273
- TegoMap1.RegionY2(7) = 58
- ' Define region #8 (the man's face).
- TegoMap1.RegionName(8) = "face"
- TegoMap1.RegionColor(8) = QBColor(14) 'Light Yellow.
- TegoMap1.RegionX1(8) = 44
- TegoMap1.RegionY1(8) = 17
- TegoMap1.RegionX2(8) = 251
- TegoMap1.RegionY2(8) = 213
- End Sub
- Private Sub Form_Resize()
- ' Size the map control to the size of the form.
- TegoMap1.Width = Me.ScaleWidth
- TegoMap1.Height = Me.ScaleHeight
- End Sub
- Private Sub mnuAbout_Click()
- Dim Title
- Dim Msg
- Dim CR
- CR = Chr(13) + Chr(10)
- ' The title of the About message box.
- Title = "About the Map Program"
- ' Prepare the message of the About message box.
- Msg = "This program was written with Visual "
- Msg = Msg + "Basic for Windows, using the "
- Msg = Msg + "TegoSoft Map OCX control. "
- Msg = Msg + CR + CR
- Msg = Msg + "The TegoSoft Map OCX control "
- Msg = Msg + "is part of the TegoSoft OCX Control "
- Msg = Msg + "Kit - a collection of various OCX controls. "
- Msg = Msg + CR + CR
- Msg = Msg + "For more information about the "
- Msg = Msg + "TegoSoft OCX Control Kit, contact TegoSoft "
- Msg = Msg + "at:"
- Msg = Msg + CR + CR
- Msg = Msg + "TegoSoft Inc." + CR
- Msg = Msg + "P.O. Box 389" + CR
- Msg = Msg + "Bellmore, NY 11710"
- Msg = Msg + CR + CR
- Msg = Msg + "Phone: (516)783-4824"
- ' Display the About message box.
- MsgBox Msg, vbInformation, Title
- End Sub
- Private Sub mnuExit_Click()
- ' Terminate the program.
- Unload Me
- End Sub
- Private Sub mnuLarge_Click()
- ' Maximize the form.
- Me.WindowState = 2
- End Sub
- Private Sub mnuNormal_Click()
- ' Set the WindowState property of the form to Normal.
- Me.WindowState = 0
- ' Set the size of the form to the default size.
- Me.Width = gDefaultWidth
- Me.Height = gDefaultHeight
- End Sub
- Private Sub mnuSmall_Click()
- ' Set the WindowState property of the form to Normal.
- Me.WindowState = 0
- ' Set the size of the form to one half of the default size.
- Me.Width = gDefaultWidth / 2
- Me.Height = gDefaultHeight / 2
- End Sub
- Private Sub TegoMap1_ClickMap(ByVal RegionId As Integer)
- ' If a valid region was clicked, display a message box.
- If RegionId <> 0 Then
- MsgBox "You clicked my " + TegoMap1.RegionName(RegionId)
- End If
- End Sub
-